import java.util.Comparator;




public class CustomerComparatorRatio implements Comparator<Customer>
{
	boolean ascending;
	int warehouseId;
	
	public CustomerComparatorRatio(boolean ascending, int warehouseId)
	{
		this.ascending = ascending;
		this.warehouseId = warehouseId;
	}
	
	public int compare(Customer c1, Customer c2)
	{
		if(ascending == true)
		{
	       return c1.cost[warehouseId] >= c2.cost[warehouseId] ? 1 : 0;
	    }
		else
		{
	    	return c1.cost[warehouseId] >= c2.cost[warehouseId] ? 0 : 1;
	    }
	}
}
